#pragma once
#define OPENEXR_DLL

#include <ImfOutputFile.h>
#include <ImfInputFile.h>
#include <ImfRgbaFile.h>
#include <ImfChannelList.h>
#include <ImfStringAttribute.h>
#include <ImfMatrixAttribute.h>
#include <ImfArray.h>
#include <Iex.h>
#include <half.h>

using namespace Imf;
using namespace Imath;

#include "CommonDefs.h"

class CExrFileIO
{
public:
	CExrFileIO(void);
	virtual ~CExrFileIO(void);

	void LoadExrFile(char* strFileName);
	void SaveExrFile(char* strFileName, RgbaChannels iChannels = WRITE_RGB);

	void SaveWarpedExrFile(char* strFileName, TransFormData_2D& trans, RgbaChannels iChannels = WRITE_RGB);

	inline int GetImgWidth() {return m_iImgWidth;}
	inline int GetImgHeight() {return m_iImgHeight;}
protected:
	Array2D<Rgba> m_arrPixels;
	int m_iImgWidth;
	int m_iImgHeight;
};

